const api = require('../../../../wxapi/config.js')
const util = require('../../../../utils/util.js')
Page({
	/**
	 * 用户点击右上角分享
	 */
	onShareAppMessage: function () {
		return {
			title: '影视行业大数据',
			path: '/pages/index/RankingList/film/film'
		}
	},
	data: {
		listData: [],
		isloading: true,
		skeleton: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10],
    closingTime: ''
	},
	getData () {
		this.setData({
			isloading: true
		})
		api.getMovieList().then((res) => {
			if (res.data.length !== 0) {
				this.setData({
					listData: res.data,
					isloading: false
				})
			} else {
				this.setData({
					listData: [],
					isloading: false
				})
			}
		})
	},
	onLoad: function (options) {
		this.getData()  
    this.setData({
      closingTime: util.formatClosingTime(new Date())
    })
	}
})